
/**
 *  \file hci_dev_attr.h
 *
 *  Module header file for HCI Device Attributes.
 */

/*
 *  Copyright (C) 2013. Mindtree Ltd.
 *  All rights reserved.
 */

#ifndef _H_HCI_DEV_ATTR_
#define _H_HCI_DEV_ATTR_

/* ------------------------------------------------- Header File Inclusion */
#include "BT_common.h"


/* -------------------------------------------------  Structures */
/** The Device Attribute Structure */
typedef struct
{
     /** BD_ADDR of the Remote Device */
     UCHAR bd_addr [BT_BD_ADDR_SIZE];

     /** Master/Slave Role */
     UCHAR role;
     UCHAR valid;

} HCI_DEVICE_ATTR;


/* ------------------------------------------------ Macros */
#if (HCI_MAX_DEVICE_ATTRIBUTES == 1)

#define hci_get_device_attr(bd) \
   (((0x1 == dev_attr_list[0].valid) && \
     (0 == BT_mem_cmp(dev_attr_list[0].bd_addr, bd_addr, BT_BD_ADDR_SIZE))) \
    ? &dev_attr_list[0] : NULL)

#endif /* HCI_MAX_DEVICE_ATTRIBUTES == 1 */


/* ------------------------------------------------ API Functions */
/** Routines to set and get the information */
#if (HCI_MAX_DEVICE_ATTRIBUTES > 1)
HCI_DEVICE_ATTR * hci_add_device_attr ( UCHAR * bd_addr );
HCI_DEVICE_ATTR * hci_get_device_attr ( UCHAR * bd_addr );
#endif /* HCI_MAX_DEVICE_ATTRIBUTES > 1 */


#endif /* _H_HCI_DEV_ATTR_ */


